all: release release_install

debug: 
	export BUILD=debug;\
	make -C c/

release: 
	export BUILD=release;\
	make -C c/

release_install:
	cp c/pipeserver ../bin;\
	cp c/vxrefserver ../bin;\
	cp sh/meta.sh ../bin;\
	cp sh/startserver.sh ../bin;\
	cp sh/cleanup.sh ../bin;\
	cp vim/vxref.vim ../plugin;

release_uninstall:
	rm -f ../bin/vxrefserver ../bin/*.sh ../bin/pipeserver ../plugin/vxref.vim;

release_tarball:
	cd ../;\
	version=`svn update | sed 's/At revision \([0-9]\+\)\./\1/g'`;\
	files="./vxrefinstall.sh ./plugin/vxref.vim ./bin/meta.sh ./bin/cleanup.sh ./bin/vxrefserver ./bin/pipeserver ./bin/startserver.sh";\
	mkdir vxref-0.$${version};\
	for f in $${files};\
	do\
		dirname=`dirname $$f`;\
		mkdir -p vxref-0.$${version}/$${dirname};\
		cp $$f vxref-0.$${version}/$${dirname};\
	done; \
	tar zvfc  vxref-0.$${version}.tar.gz vxref-0.$${version};\
	rm -fr vxref-0.$${version}

install:
	cd ..;\
		./vxrefinstall.sh

clean:
	cd c;\
	make clean;
	
	
